const common = require('./webpack.common')
const { merge } = require('webpack-merge')
const webpack = require('webpack')

module.exports = merge(common, {
  mode: 'development',
  devtool: 'inline-source-map',
  devServer: {
    contentBase: './public', // 用来指定服务器获取静态资源的根路径
    port: '3001', // 配置端口号
    hot: true, // 是否启用模块的热替换功能
    open: true // 是否自动打开浏览器
  },
  plugins: [
    new webpack.HotModuleReplacementPlugin() // 启动热更新插件
  ]

})
